<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Db;

class ArticleController extends Controller
{




    /**
     * @OA\Post(
     *     path="/article_push",
     *     tags={"文章"},
     *     summary="公告推送",
     *     @OA\Parameter(
     *         name="Authorization",
     *         in="header",
     *         description="bearer+token"
     *     ),
     *     @OA\Response(
     *         response="200",
     *         description="正常",
     *     )
     * )
     */
    public function push(Request $request)
    {
        $where = [];
        $post_data = $request->all();
        $time = date('Y-m-d H:i:s');
        $where[] = ['start_time','<=',$time];
        $where[] = ['end_time','>=',$time];
        $admin_list = Db::table('article')
            ->where('category','公告推送')
            ->where($where)
            ->select('title','id','add_time','pic','category','synopsis')
            ->orderByDesc('id')
            ->get;
        return s_msg('',$admin_list);
    }



}
